import dao.UserDao;
import entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test1 {
    public static void main(String[] args) {
        User user = new User("hehehheh","12345","1871781781","江苏-苏州");
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationcontext.xml");
        UserDao userDao = (UserDao) ac.getBean("userDao");
        Long key = userDao.insertReturnPrimaryKey(user);
        System.out.println("新增成功"+key);
    }
}
